import PureRunnableGroupForm from '../components/runnable-group-form';
import * as ReactRedux from 'react-redux';
import * as RunnableGroupAction from 'actions/runnable-group';
import * as DevTeamAction from 'actions/dev-team';
import * as CompanyAction from 'actions/company';

const mapDispatchToProps = (dispatch) => {
  return {
    onSaveRunnableGroup: (runnableGroup) => {
      return dispatch(RunnableGroupAction.create(runnableGroup));
    },
    onCompanyChange: (companyId) => {
      return dispatch(DevTeamAction.managedDevTeam(companyId));
    },
    onDevTeamChange: (devTeamId) => {
      return dispatch(CompanyAction.managedCompany(devTeamId));
    }
  };
};

export default ReactRedux.connect(undefined, mapDispatchToProps)(PureRunnableGroupForm);
